package section11;

class MyThread11_2 implements Runnable{
    private String who;
    public MyThread11_2(String str){
        who=str;
    }
    @Override
    public void run() {
        for(int i=0;i<5;i++){
            try{
                Thread.sleep((int)(1000*Math.random()));
            }
            catch (InterruptedException e){
                System.out.println(e.toString());
            }
            System.out.println(who+"正在搞事！");
        }
    }
}
public class App11_2 {
    public static void main(String[] args) {
        MyThread11_2 you=new MyThread11_2("傻蛋");
        MyThread11_2 me=new MyThread11_2("医生");
        Thread t1=new Thread(you);
        Thread t2=new Thread(me);
        t1.start();
        t2.start();
        System.out.println("主方法main开始running！");
    }
}
